/*
 * hybrid.c
 *
 *  Created on: Apr 19, 2009
 *      Author: thaison
 */

#include <iostream.h>

#include "ants.h"
#include "utilities.h"
#include "InOut.h"
#include "TSP.h"
#include "timer.h"
#include "ls.h"
#include "acotsp.h"
#include "anneal.h"
#include "GA.h"
#include "solution.h"

int Hybrid_main(int argc, char* argv[]) {
	cout << "The Hybrid algorithm has been chosen.\n" << endl;
	int myid, numprocs;
	// Init MPI environment
	MPI_Init(&argc, &argv);
	MPI_Comm_size(MPI_COMM_WORLD, &numprocs);
	MPI_Comm_rank(MPI_COMM_WORLD, &myid);

	construct_datatypes();

	Solution ga_solution = PGA(myid, 50, 1000, 0.1, 1.0);

	MPI_Barrier(MPI_COMM_WORLD);

	long int distance = PSA(ga_solution.tour, myid, ga_solution.cost, 0.99999,
			0.00001, 5);

	printf("the best goes here :%li\n", distance);
	cout << "time taken : " << elapsed_time();

	MPI_Finalize();

	return 0;
}
